# Contributor: mio <miyopan@e.email>
# Maintainer: mio <miyopan@e.email>
pkgname=ibus-anthy
pkgver=1.5.15
pkgrel=2
pkgdesc="Japanese input method Anthy IMEngine for IBus Framework"
url="https://github.com/ibus/ibus-anthy"
arch="all !s390x" # ibus needs librsvg which isn't available on s390x
license="GPL-2.0-only"
depends="
	ibus
	py3-gobject3
	"
makedepends="
	anthy-dev
	autoconf
	automake
	gobject-introspection-dev
	ibus-dev
	intltool
	m4
	"
checkdepends="
	bash
	libfaketime
	sed
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/ibus/ibus-anthy/archive/$pkgver.tar.gz"
subpackages="$pkgname-lang"

prepare() {
	default_prepare

	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--prefix=/usr \
		--host=$CHOST \
		--build=$CBUILD \
		--libexec=/usr/lib/ibus
	make
}

check() {
	# tests use current date output and need yearly updates
	# they also run rm -r HOME/.config/anthy ...
	HOME="$builddir" \
	faketime '2021-01-01' \
		make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
0acebb1b397f98d156ba9d6465bdb1025fb23a6b05b72c9b471827b45e22af55468b7674469f348712682446641c98d68f3d2aa339d2a1997a2df8c2bac45a7c  ibus-anthy-1.5.15.tar.gz
"
